class Document {
    static hasMany = [tags:Tag]

    static belongsTo = [Cms]

    static searchable = {
        title()
        description()
        type()
    }

    static constraints = {
        title(nullable:false, maxSize:128)
        description(nullable:false, maxSize:1000)
        type(inList:["application/pdf", "doc", "binary"])
    }
    

    Cms cms
    String title
    String description
    Date created = new Date()
    String type = "binary"

    String toString(){
        "Document {id} - ${title}"
    }

    
}
